﻿using UnityEngine;
using System.Collections;

public class Path : MonoBehaviour
{
    // variables
    public bool debug = true;
    public GameObject[] points;

    // Use this for initialization
    void Start()
    {
        pointsLength = points.Length;
    }
    
    // Update is called once per frame
    void Update()
    {
    }
    
    
    public int length()
    {
        return points.Length;
    }

    // Draws the path
    void OnDrawGizmos()
    {
        
        if (!debug)
            return;
        
        // go through all points except the last one
        int pLength = pointsLength - 1;
        
        for (int i = 0; i < pLength; i++)
        {
            Debug.DrawLine(points [i].transform.position, points [i + 1].transform.position, Color.yellow);
        }
    }
}
